<?php
class LanguageHook {
  var $CI;
  function LanguageHook() {
    $this->CI = &get_instance();
  }
  function setLang() {
    $temp = '';
    $language_config = $this->CI->config->item( 'language_config' );
    if( userdata( 'currentLang' ) == '' ) {
      $temp = 'default';      
      set_userdata( 'currentLang', $temp );
    } else $temp = userdata( 'currentLang' );
    $this->CI->lang->load( $language_config[ $temp ][ 'langFile' ], $language_config[ $temp ][ 'folder' ] );
  }
}
